﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestMarco
{
    class Program
    {
        static void Main(string[] args)
        {
            string appPath =
                System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
            UsbGuard.Core.Intelligence intel = new UsbGuard.Core.Intelligence(null, appPath, false);
            intel.UnregisteredStickRecognized += new UsbGuard.Core.Intelligence.UnregisteredStickRecognizedHandler(intel_UnregisteredStickRecognized);
            foreach (UsbGuard.Core.USBDeviceInfo devinfo in intel.ConnectedUSBDevices)
            {
                try
                {
                    //intel.RegisterUsbStick(devinfo.DeviceID, "test");
                }
                catch { }
                break;
            }
            intel.Start();            
            Console.ReadKey();
        }

        static void intel_UnregisteredStickRecognized()
        {
            string appPath =
                System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
            System.Diagnostics.Process.Start(appPath + "\\UsbGuard.Alarm.exe");
        }
    }
}
